package arg

import (
	"github.com/gurkankaymak/hocon"
	"db2s/global"
)

func getHoconConfigParameter(input any, hocon *hocon.Config) (parameter map[string]any, err error) {
	var syncMap = make(map[string]any)
	parameter = make(map[string]any)
	if syncMap, err = global.StructToMapAny(input); err != nil {
		return
	}
	for k, v := range syncMap {
		qq := recursionParameterHoconConfig(hocon, k)
		if qq == nil {
			parameter[k] = v
		} else {
			parameter[k] = qq
		}
	}
	return
}
